package com.witker.system.user.bean;


import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;

/**
 * 用户实体
 * Created by BOCAI on 2018/4/19 22:09.
 */
public class User {

    /**
     * 用户编号
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @TableField
    private String username;

    /**
     * 密码
     */
    @TableField
    private String password;

    /**
     * 电子邮箱
     */
    @TableField
    private String email;

    /**
     * 每日可领取数量
     */
    @JSONField(name = "max_hongbao")
    @TableField(value="max_hongbao")
    private Integer maxHongbao;

    /**
     * 分享的cookie/QQ数量
     */
    @JSONField(name = "share_num")
    @TableField(value="share_num")
    private Integer shareNum;

    /**
     * 用户当前积分
     */
    @TableField
    private Integer count;

    /**
     * 用户当前激活状态    0是未激活，1是已激活
     */
    @TableField
    private Integer active;

    /**
     * 是否阅读公告    0是未阅读，1是已阅读
     */
    @TableField
    private Integer attention;

    /**
     * 注册时间
     */
    @JSONField(name = "sign_date", format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value="sign_date")
    private Date signDate;

    /**
     * 签到天数
     */
    @JSONField(name = "sign_count")
    @TableField(value="sign_count", condition = SqlCondition.LIKE)
    private Integer signCount;

    /**
     * 最后活跃时间
     */
    @JSONField(name = "last_active", format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value="last_active")
    private Date lastActive;

    public User(Integer id, String username, String password, String email, Integer maxHongbao, Integer shareNum, Integer count, Integer active, Integer attention, Date signDate, Integer signCount, Date lastActive) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.maxHongbao = maxHongbao;
        this.shareNum = shareNum;
        this.count = count;
        this.active = active;
        this.attention = attention;
        this.signDate = signDate;
        this.signCount = signCount;
        this.lastActive = lastActive;
    }

    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", maxHongbao=" + maxHongbao +
                ", shareNum=" + shareNum +
                ", count=" + count +
                ", active=" + active +
                ", attention=" + attention +
                ", signDate=" + signDate +
                ", signCount=" + signCount +
                ", lastActive=" + lastActive +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getMaxHongbao() {
        return maxHongbao;
    }

    public void setMaxHongbao(Integer maxHongbao) {
        this.maxHongbao = maxHongbao;
    }

    public Integer getShareNum() {
        return shareNum;
    }

    public void setShareNum(Integer shareNum) {
        this.shareNum = shareNum;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getActive() {
        return active;
    }

    public void setActive(Integer active) {
        this.active = active;
    }

    public Integer getAttention() {
        return attention;
    }

    public void setAttention(Integer attention) {
        this.attention = attention;
    }

    public Date getSignDate() {
        return signDate;
    }

    public void setSignDate(Date signDate) {
        this.signDate = signDate;
    }

    public Integer getSignCount() {
        return signCount;
    }

    public void setSignCount(Integer signCount) {
        this.signCount = signCount;
    }

    public Date getLastActive() {
        return lastActive;
    }

    public void setLastActive(Date lastActive) {
        this.lastActive = lastActive;
    }
}
